//面向过程的三角形面积计算程序
// NOLINTBEGIN
#include <cmath>
#include <iostream>
using namespace std;

int main() {
  double a, b, c, s, area;

  cout << "Please enter the three sides of the triangle:" << endl;
  cout << "Side a: ";
  cin >> a;
  cout << "Side b: ";
  cin >> b;
  cout << "Side c: ";
  cin >> c;

  if (!(a + b > c && a + c > b && b + c > a)) {
    cout << "This is not a triangle. Please enter again." << endl;
  }

  s    = (a + b + c) / 2;
  area = sqrt(s * (s - a) * (s - b) * (s - c));
  if (a + b > c && a + c > b && b + c > a) {
    cout << "The area of the triangle is " << area << endl;
  }

  system("pause");
  return 0;
}
// NOLINTEND